package com.example.javabase.reference;

import java.lang.ref.SoftReference;

/**
 * @author He Changjie on 2021/7/6
 */
public class SoftReferenceTest {

    public static void main(String[] args){
        System.out.println("开始");
        A a = new A();
        SoftReference<A> sr = new SoftReference<A>(a);
        a = null;
        a = sr.get();
        System.out.println("结束");
    }
}

class A{
    int[] a ;
    A(){
        a = new int[100000000];
    }
}

